package com.hacker.spider;

import com.hacker.spider.concurrent.ResultActuator;
import com.hacker.spider.wallhaven.WallHavenSpider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Spider {
  private static final Logger logger = LoggerFactory.getLogger(Spider.class);

  public static void main(String[] args) throws InterruptedException {

    WallHavenSpider wallHavenSpider = new WallHavenSpider();
    ResultActuator.getInstance().addTask(wallHavenSpider);
    do {
      Thread.sleep(2000);
    } while (!ResultActuator.getInstance().isFinish());
    logger.debug("image download finish.");
    ResultActuator.getInstance().shutDown();
  }
}
